<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ taglib prefix="tags" tagdir="/WEB-INF/tags"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<c:if test="${includeBody}">
<head>
    <title><fmt:message key="relationship" /></title>
</head>
<body>
</c:if>
    <div id="relationshipSearchResultFragment">
        <h1><fmt:message key="relationship" /></h1>
        <script type="text/javascript">
            dojo.addOnLoad(function() {
                dojo.query(".relationshipAjaxSearch").forEach(function(element) {
                    Spring.addDecoration(new Spring.AjaxEventDecoration({
                        elementId: element.id,
                        event: "onclick",
                        params: { decorator: "none" }
                    }));
                })
                dojo.query(".relationshipAjaxDelete").forEach(function(element) {
                    Spring.addDecoration(new Spring.AjaxEventDecoration({
                        elementId: element.id,
                        event: "onclick",
                        popup: "true",
                        params: { decorator: "none" }
                    }));
                })
				dojo.query("a.ajaxPagerLink").forEach(function(element) {
					Spring.addDecoration(new Spring.AjaxEventDecoration({
						elementId: element.id,
						event: "onclick",
						params: { decorator: "none" }
					}));
				})
            });
        </script>
        <c:url var="searchUrl" value="/domain/relationship/search.action"/>
        <table class="listEntities">
            <thead>
                <tr>
                    <th scope="col">
                        <a id="sortLinkrelationTypeValue" class="relationshipAjaxSearch" href="${searchUrl}?${relationshipSearchForm.relationTypeValueQueryStringForSortableHeader}">
                            <fmt:message key="relationship_relationTypeValue"/>&nbsp;${relationshipSearchForm.relationTypeValueSortStatusEntity}
                        </a>
                    </th>

                    <th scope="col">
                        <a id="sortLinkparentStructureInode" class="relationshipAjaxSearch" href="${searchUrl}?${relationshipSearchForm.parentStructureInodeQueryStringForSortableHeader}">
                            <fmt:message key="relationship_parentStructureInode"/>&nbsp;${relationshipSearchForm.parentStructureInodeSortStatusEntity}
                        </a>
                    </th>
                    <th scope="col">
                        <a id="sortLinkchildStructureInode" class="relationshipAjaxSearch" href="${searchUrl}?${relationshipSearchForm.childStructureInodeQueryStringForSortableHeader}">
                            <fmt:message key="relationship_childStructureInode"/>&nbsp;${relationshipSearchForm.childStructureInodeSortStatusEntity}
                        </a>
                    </th>
                    <th scope="col">
                        <a id="sortLinkcardinality" class="relationshipAjaxSearch" href="${searchUrl}?${relationshipSearchForm.cardinalityQueryStringForSortableHeader}">
                            <fmt:message key="relationship_cardinality"/>&nbsp;${relationshipSearchForm.cardinalitySortStatusEntity}
                        </a>
                    </th>
                    <th scope="col">
                        <a id="sortLinkparentRequired" class="relationshipAjaxSearch" href="${searchUrl}?${relationshipSearchForm.parentRequiredQueryStringForSortableHeader}">
                            <fmt:message key="relationship_parentRequired"/>&nbsp;${relationshipSearchForm.parentRequiredSortStatusEntity}
                        </a>
                    </th>
                    <th scope="col">
                        <a id="sortLinkchildRequired" class="relationshipAjaxSearch" href="${searchUrl}?${relationshipSearchForm.childRequiredQueryStringForSortableHeader}">
                            <fmt:message key="relationship_childRequired"/>&nbsp;${relationshipSearchForm.childRequiredSortStatusEntity}
                        </a>
                    </th>
                    <th scope="col">&nbsp;</th>
                </tr>
            </thead>
            <tbody>
            <c:forEach items="${relationships}" var="relationship" varStatus="status">
                <tr>
                    <td>
                        <c:out value="${relationship.relationTypeValue}"/>
                    </td>
                    <td>
                        <c:out value="${relationship.parentStructure.name}"/>
                    </td>
                    <td>
                        <c:out value="${relationship.childStructure.name}"/>
                    </td>
                    <td>
                        <c:out value="${relationship.cardinalityName}"/>
                    </td>
                    <td>
                        <c:out value="${relationship.parentRequired}"/>
                    </td>
                    <td>
                        <c:out value="${relationship.childRequired}"/>
                    </td>
                    <td>
                        <c:url var="showUrl" value="/domain/relationship/show.action">
                            <c:param name="relationship.inode" value="${relationship.inode}"/>
                        </c:url>
                        <c:url var="updateUrl" value="/domain/relationship/updateForm.action">
                            <c:param name="relationship.inode" value="${relationship.inode}"/>
                        </c:url>
                        <c:url var="confirmDeleteUrl" value="/domain/relationship/confirmDelete.action">
                            <c:param name="relationship.inode" value="${relationship.inode}"/>
                        </c:url>
                        <a class="actionShow" href="${showUrl}"><fmt:message key="label.link.show"/></a>
                        <a class="actionUpdate" href="${updateUrl}"><fmt:message key="label.link.update"/></a>
                        <a class="actionDelete relationshipAjaxDelete" id="confirmDeleteUrl${status.index}" href="${confirmDeleteUrl}"><fmt:message key="label.link.delete"/></a>
                    </td>
                </tr>

            </c:forEach>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="10">
                        <p>
                            <tags:navigation pager="${pagerDisplay}" url="${searchUrl}" form="${relationshipSearchForm}"/>
                        </p>
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>
<c:if test="${includeBody}">
</body>
</c:if>